<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>父子传参</title>
		<script src="https://cdn.jsdelivr.net/npm/vue"></script>
	</head>
	<body>
		<div id="app">
			<ol>
				<todo-item v-for="item in oftenFoods" :todo="item" :key="item.id"></todo-item>
			</ol>
		</div>
		<script>
			Vue.component('todo-item',{
				props:['todo'],
				template:'<li>{{todo.name}}</li>'
				
			})
			var vm = new Vue({
				el:'#app',
				data:{
					oftenFoods:[
					  {id:1,name:'王超'},
					  {id:2,name:'王强'},
					  {id:3,name:'王杰'}
					]
				}
			})
		</script>
	</body>
</html>
